<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>知识列表</title>
    <meta name="renderer" content="webkit"/> 
    <meta name="force-rendering" content="webkit"/> 
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"/> 
    <link rel="stylesheet" type="text/css" href="/static/css/hw-admin.css">
</head>
<body style="background:#fff">
    <div class="hw-header-wrapper">
            <div class="hw-header">
                <div class="hw-header__item--left">
                 知识列表
                </div>
                <div class="hw-header__item--right">
                    <div class="hw-btn-group">
                        <a href="<?=base_url().'Admin/Lore/loreAdd'?>"class="k-white hw-btn--normal" >发布知识</a>
                    </div>
                </div>                
            </div>
    </div>
        <div class="main-table-wrap">
            <form id="table-form" method="post" action="">
             <input type="hidden" value="" name="id" id="exportid">
                <table cellspacing="0" cellpadding="0" border="0" id="first-table">  
                    <colgroup> 
                        <col class="col-2">
                        <col class="col-10">
                        <col class="col-10">
                        <col class="col-4">
                        <col class="col-10">
                        <col class="col-5">                                          
                    </colgroup>
                    <thead>
                        <tr> 
                            <th> 
                            序号
                            </th>                            
                            <th>知识名称</th>
                            <th>知识分类</th>
                            <th>发布状态</th>                                                        
                            <th>
                             创建时间
                            </th>
                           <th>操作</th> 
                        </tr>
                    </thead>
                    <tbody>
                        <?php foreach ($list as $key => $value): ?>
                            <tr>  
                                <td><?=$key+1 ?></td>
                                <td><?=$value['name'] ?></td>
                                <td><?=$value['type'] == 1 ? '音乐' : ($value['type'] == 2 ? '案例' : '台词')  ?></td>
                                <td><?=$value['state'] == 1 ? '已发布' : ($value['type'] == 2 ? '已下架' : '待发布')  ?></td>
                                <td><?=$value['create_time'] ?></td>
                                <td class="opt">
                                <a class="iconright blue-color delete" href="<?=base_url().'Admin/Lore/loreUpdate/'.$value['id'] ?>"><i class="iconfont">&#xe605;</i>编辑</a>
                                <?php if ($value['state'] == 0 || $value['state'] == 2): ?>
                                    <a class="iconright blue-color delete" href="<?=base_url().'Admin/Lore/loreRelease/'.$value['id'].'/1' ?>"><i class="iconfont">&#xe614;</i>发布</a>
                                <?php else: ?>
                                    <a class="iconright blue-color delete" href="<?=base_url().'Admin/Lore/loreRelease/'.$value['id'].'/2' ?>" style="color:red"><i class="iconfont">&#xe6f7;</i>下架</a>
                                <?php endif ?>
                                </td>
                            </tr>
                        <?php endforeach ?>
                    </tbody>
                </table>
                <?php $this->load->view('Admin/Page/page') ?>
            </form>
            <!--列表分页 -->
        </div>
<!-- 添加分类模态框-->
    <div class="modal hide" id="classModal">
            <div class="modal-mask"></div>
      <form id="addclass-form" method="post" action="">
            <div class="modal-content">
              <div class="modal-header">
                  <i class="iconfont" data-dismiss="modal">&#xe63d;</i>
                  <div class="modal-title">添加分类</div>
              </div>
               <div class="modal-body " style="margin-top:20px;">
                  <div class="group-info">
                    <div class="group-item">
                        <div class="hw-input-label" >
                            <div class="name"><span>*</span>分类名称</div>
                            <div class="form-control" style="height:48px;">
                                <input class="hw-input memberName" type="text"  name="memberName"  required placeholder="请输入内容">
                            </div>
                        </div>
                  </div>
                </div>
             </div>
              <div class="modal-footer">
                  <button class="hw-btn--normal" type="submit">确定</button>

                  <button class="hw-btn--default" type="button" data-dismiss="modal">取消</button>
              </div>
            </div>
            </form>
       </div> 
<script type="text/javascript" src="/static/lib/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="/static/lib/jquery.form.min.js"></script>
<script type="text/javascript" src="/static/lib/jquery.validate.js"></script>
<script type="text/javascript" src="/static/lib/messages_zh.js"></script>
<script type="text/javascript" src="/static/lib/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="/static/js/common/util.js"></script>
<script type="text/javascript" src="/static/js/common/common.js"></script>
<script>
$(".export").click(function(){
    var checked=$(":checked")
    var arr=[]
    for(var i=0;i<checked.length;i++){
        if($(checked[i]).attr("data-id")!=null){
         arr.push($(checked[i]).attr("data-id"))
        }
    }
    if(arr.length==0){
        $.alert("请选择")
        return false
    }
        $.confirm({
        msg:"<i class='iconfont' style='color:#eac149;margin-right:5px;''>&#xe640;</i>确定批量导出?",
        confirm:function(){
        $("#exportid").val(arr);
        $("#table-form").submit()
        }
    })

})


</script>
</body>
</html>